<?php
 include('../php_includes.php');
	//require_once 'admin_options.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!--Get data values of manager id in order to transfer employees from manager to manager.
    If first manager and second manager values are empty, then form was not submitted.
    Accessing the page by typing the url of the page will prompt a error message, which
    will provide a link to return to page that let user to submit the form. The transfer is
    accomplished by updating the employee's manager id.
-->

<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    <title>Payroll and Timesheet Management Website</title>
    <link rel="stylesheet" type="text/css" href="adminStyle.css"/>
	<script type="text/javascript" src="pwcheck.js">
	</script>
  </head>
  <body>
  
	<?php writeHeader(); ?>
        <?php  //Get data values
          $firstManager = $_POST["firstManager"];
          $secondManager = $_POST["SecondManager"];
          $check = $_POST["hide"];
          if($check != "hidden")
          {
            echo "<p> Transaction invalid. </p>";
            echo "<p><a href='adminDeletion.php'>Go back to Admin Delete Manager</a></p>";
          }
          else
          {
            sqlConnect();
            $getId = "UPDATE Employee SET ManagerID = '$secondManager' WHERE ManagerID = '$firstManager' AND EmployeeID != '$firstManager';";
            sqlQuery($getId);
            sqlExit();
            echo "<p> Your transaction was successfully. </p>";
            echo "<p><a href='adminDeletion.php'>Go back to Admin Delete Manager</a></p>";
          }
        ?>
</body>
</html>
	